package com.time;

/**
 * @author yonghao.tang
 * @version 1.0
 * @date 2024年07月10日 下午7:35
 */

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;

/**
 * @author yonghao.tang
 */

@WebServlet("/resource2")
public class ResourceServlet2 extends HttpServlet {
    
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException {
        //测试地址：http://localhost:8080/saml-okta/resource2?query=test
        
        String queryString = request.getParameter("query");
        response.setContentType("text/html;charset=UTF-8");
        for (String s : Arrays.asList("这个是系统受保护资源，只允许登陆用户才能访问</br></br>", "查询参数queryString：" + queryString)) {
            response.getWriter().println(s);
        }
    }
}
